using System;
using Core.Model;
using UI.Models.Account;

namespace UI.Controllers
{
    public class AccountMapper
    {
        public Show From(Account account)
        {
            if (account == null) throw new ArgumentNullException("account");
            var show = new Show();
            show.Address1 = account.Address1;
            show.Address2 = account.Address2;
            show.City = account.City;
            show.Country = account.Country;
            show.Email = account.Email;
            show.FirstName = account.FirstName;
            show.IsShowBanners = account.IsShowBanners;
            show.IsShowFavorites = account.IsShowFavorites;
            show.Language = account.Language;
            show.LastName = account.LastName;
            show.Phone = account.Phone;
            show.State = account.State;
            show.UserId = account.UserId;
            show.Zip = account.Zip;
            if (account.Category != null)
            {
                show.Category = new CategoryMapper().From(account.Category);
            }
            return show;
        }
    }
}